import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login.vue"
import Uploadimg from '../views/Uploadimg.vue'
import User from '../views/User.vue'
import Home from '../views/Home.vue'
import Point from '../views/Point.vue'
import Imglist from '../views/Imglist.vue'
import Register from '../views/Register.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/',
    name: 'register',
    component: Register
  },
  {
    path: '/home',
    name: 'Home',
    redirect: {name: "uploadimg"},
    component: Home,
    children: [
      {
        path: '/uploadimg',
        name: 'uploadimg',
        component: Uploadimg
      },
      {
        path: '/imglist',
        name: 'imglist',
        component: Imglist
      },
      {
        path: '/user',
        name: 'user',
        component: User
      },
      {
        path: '/point',
        name: 'point',
        component: Point
      },
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
